package com.common;

import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;
import com.po.UserSys;

public class LoginInterceptor extends MethodFilterInterceptor {

	public String doIntercept(ActionInvocation invocation) throws Exception {
		ActionContext ac = invocation.getInvocationContext();
		Map session = ac.getSession();
		
		UserSys _user = (UserSys) session.get("User");
		if(_user!=null){
			String sul= invocation.invoke();
			return sul;
		}else{
			return "nologin";
		}
	}

}
